SRC = $(wildcard *.s)
OBJ = $(SRC:%.s=%.o) 
BIN = $(OBJ:%.o=%)

AS = as
CC = ld

LDFLAGS = -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -lc
ASFLAGS = --32

clean : 
	rm $(OBJ)
cleanall : 
	rm $(BIN) $(OBJ)
sizetest1.o : sizetest1.s
	$(AS) $(ASFLAGS) -o $@ $<
cmovtest.o : cmovtest.s
movtest3.o : movtest3.s
makefilo : makefile
movtest4.o : movtest4.s
movtest1.o : movtest1.s
swaptest.o : swaptest.s
sizetest2.o : sizetest2.s
movtest2.o : movtest2.s
sizetest3.o : sizetest3.s
cmpxchgtest.o : cmpxchgtest.s
bubble.o : bubble.s
pushpop.o : pushpop.s

sizetest1 : sizetest1.o
	$(CC) $(LDFLAGS) -o $@ $<
cmovtest : cmovtest.o
movtest3 : movtest3.o
makefi : makefilo
movtest4 : movtest4.o
movtest1 : movtest1.o
swaptest : swaptest.o
sizetest2 : sizetest2.o
movtest2 : movtest2.o
sizetest3 : sizetest3.o
cmpxchgtest : cmpxchgtest.o
bubble : bubble.o
pushpop : pushpop.o
all : sizetest1 cmovtest movtest3 makefi movtest4 movtest1 swaptest sizetest2 movtest2 sizetest3 cmpxchgtest bubble pushpop clean
